home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / process.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  1.0 KB  |  43 lines

  1. /*
  2. \funcref{process}{void process ()}
  3.     {}
  4.     {}
  5.     {getopcode()}
  6.     {}
  7.     {process.c}
  8.     {
  9.         Function {\em process()} is the main loop of the execution of the
  10.         binary makefile. It is called from {\em main()} when the variables are
  11.         read and when the offsets of the variable section and of the strings
  12.         section are known.
  13.  
  14.         An opcode is retrieved from the binary makefile and appropriate action
  15.         is taken until an {\em op\_ret} opcode is encountered.
  16.     }
  17. */
  18.  
  19. #include "icm-exec.h"
  20.  
  21. void process ()
  22. {
  23.     register
  24.         OPCODE_ op;
  25.  
  26.     arghead = xstrdup (nullstring);
  27.     argtail = xstrdup (nullstring);
  28.     cmdhead = xstrdup (nullstring);
  29.     cmdtail = xstrdup (nullstring);
  30.  
  31.     do
  32.     {
  33.         curoffs = (unsigned) ftell (infile);
  34.         if ( (op = getopcode (infile)) >= op_hlt || op == -1 )
  35.         {
  36.             fprintf (stderr, "bad opcode at %s ", hexstring (curoffs, 4));
  37.             error ("(opcode %s)", hexstring (op, 2));
  38.         }
  39.         procfun [op] ();
  40.     }
  41.     while (op != op_exit);
  42. }
  43.